import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from '@/store'
import Vant, { Lazyload } from 'vant'
import 'vant/lib/index.css'
import '@/icons'
import '@/components/MilkVue'
import rem, { deviceWidth } from '@/utils/rem'
import { apiAxios } from '@/api/axios'
import { algorithms } from '@/store/modules/Algorithm'
// import F2 from '@antv/f2'
require('@antv/f2/lib/interaction')
// eslint-disable-next-line @typescript-eslint/no-var-requires

// const ScrollBar = require('@antv/f2/lib/plugin/scroll-bar')
// F2.Chart.plugins.register(ScrollBar)

Vue.use(Vant)
Vue.use(Lazyload)
Vue.config.productionTip = false

rem(deviceWidth())
router.beforeEach((to, from, next) => {
  document.title = '特斯联 AI算法舱'
  store.state.var.activeMenu = to.params.id
  next()
})

apiAxios.get('/open/algorithm/list').then(res => {
  algorithms.list = res.data
  new Vue({
    router,
    store,
    render: h => h(App)
  }).$mount('#app')
})
